package com.admin.dao

import com.data.annotation.NoargAnnotation
import com.data.annotation.OpenAnnotation
import com.data.bean.Account
import com.data.entity.IndexAdminState
import org.apache.ibatis.annotations.Param
import org.springframework.stereotype.Repository

@Repository
@OpenAnnotation
@NoargAnnotation
interface AccountAdminDao {
    /**
     * 查询全部账号
     *
     * @return
     */
    fun accountListDao(): List<Account>

    /**
     * 根据指定的id删除账号
     *
     * @param id
     * @return
     */
    fun deleteAccountDao(@Param("id") id: String): Int

    /**
     * 修改账号的状态
     *
     * @param accountAdmin
     * @return
     */
    fun changeAccountDao(@Param("accountAdmin") accountAdmin: IndexAdminState): Int

    /**
     * 检测账号是否被占用
     *
     * @param username
     * @param type
     * @return
     */
    fun checkAccountDao(@Param("username") username: String, @Param("type") type: Int): List<Account>

    fun saveMassageDao(@Param("account") account: Account): Int
}
